home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 126-150 / scopedisk148 / powerplatform / rexx / extract.app < prev    next >
Text File  |  1995-03-19  |  3KB  |  54 lines

  1. /************************************************************************/
  2. /*                               Extract                                */
  3. /*                               =======                                */
  4. /*                                                                      */
  5. /* This ARexx EXEC will extarct all files from an archive file. The     */
  6. /* archive can be constructed with arc, zoo or lharc. The filetype      */
  7. /* will be used to determine the archive format used.                   */
  8. /*                                                                      */
  9. /* This EXEC is designed to be used with APB, the Amiga Power Bench.    */
  10. /*                                                                      */
  11. /*                                              ==> MCW 01/27/90 <==    */
  12. /************************************************************************/
  13.  
  14. trace off                                   /* Disable ARexx tracing    */
  15.  
  16. parse upper arg fname                       /* Get file name            */
  17.  
  18. if fname = '' then do                       /* No filename passed?      */
  19.     'Message No filename Specified.'        /* Send message back to APB */
  20.     'Beep'                                  /* Sound the alarm          */
  21. end
  22.  
  23. ftype = substr(fname, lastpos(".", fname) +1)
  24.  
  25. if ftype = "ARC" then do                    /* Arc file?                */
  26.     address command 'ARC <* e' fname        /* UnArc file               */
  27.     return                                  /* Return to APB            */
  28. end
  29.  
  30. if ftype = "ZOO" then do                    /* Zoo file?                */
  31.     address command 'ZOO <* e//' fname      /* UnZoo file               */
  32.     return                                  /* Return to APB            */
  33. end
  34.  
  35. if ftype = "LZH" then do                    /* LhArc file?              */
  36.     address command 'LHARC <* -x x' fname   /* UnLhArc file             */
  37.     return                                  /* Return to APB            */
  38. end
  39.  
  40. if ftype = "ZIP" then do                    /* Zip file?                */
  41.     address command 'UnZip <*' fname        /* UnZip file               */
  42.     return                                  /* Return to APB            */
  43. end
  44.  
  45. if pos('UU', ftype) ~= 0 then do            /* UUencoded file?          */
  46.     address command 'UUdeCode <*' fname     /* Decode file              */
  47.     return                                  /* Return to APB            */
  48. end
  49.  
  50. 'Message Unrecognized filetype.'            /* Not arc, zoo or lharc    */
  51. 'Beep'                                      /* Sound the alarm          */
  52.  
  53. return 0                                    /* Return to APB            */
  54.